using System;
using System.Xml;
using System.Xml.Serialization;

/*
  <sentence>
			<number>4</number>
			<place>6</place>
			<connecting-word>on</connecting-word>
			<next-id>2</next-id>
	</sentence>
*/
namespace TextParsing.GraphStructure
{
	public class Sentence
	{
		private int m_number;
		private int m_place;
		private string m_connectingWord = null;
		private long m_nextId = -9;

		[XmlElement("number")]
		public int Number
		{
			get { return m_number; }
			set { m_number = value; }
		}

		[XmlElement("place")]
		public int Place
		{
			get { return m_place; }
			set { m_place = value; }
		}

		[XmlElement("connecting-word",IsNullable = true)]
		public string ConnectingWord
		{
			get { return m_connectingWord; }
			set { m_connectingWord = value; }
		}

		[XmlElement("next-id")]
		public long NextId
		{
			get { return m_nextId; }
			set { m_nextId = value; }
		}

		public void AddConnectingWord(string connectingWord)
		{
			if (m_connectingWord == null) m_connectingWord = connectingWord;
			else m_connectingWord+="," + connectingWord;
		}

		/// <summary>
		/// Create instance of the Sentence class
		/// </summary>
		/// <returns></returns>
		public static Sentence CreateNewSentence() { return new Sentence(); }
	}
}
